<?php

namespace IDock\Insurance\ZYIC\Response;

use IDock\Http\Response;
use IDock\Insurance\ZYIC\Response\AllZYICResponse;
use IDock\Printer\NonCar\NonCarProductListPrinter;
use IDock\Printer\NonCar\NonCarProductPrinter;
use IDock\Printer\NonCar\NonCarSubCoveragePrinter;
use IDock\Printer\UnderwritingRecallPrinter;

class NonCarProductListResponse extends AllZYICResponse
{
    public $seat = '';

    public $productCodeList = [];

    public $printer = NonCarProductListPrinter::class;

    public function printerInit(): Response
    {
        $printer = new NonCarProductListPrinter();

        $list = [
            [
                'productCode' => '155',
                'productName' => '乐驾保基本计划(5座版)',
                'planCode' => '15',
                'planName' => '乐驾保基本计划(5座版)',
                'premium' => '168.00',
                'amount' => '1813000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '10万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '1万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '50元/天/座',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '20万元/户',
                        'subName' => '房屋、室内装修、室内财产',
                    ],
                    [
                        'amount' => "累计赔偿限额100万、每次事故赔偿限额50万、每次事故财产损失赔偿限额20万、每人每次赔偿限额30万、每人医疗费用赔偿限额10万",
                        'subName' => '民用燃气附加第三者责任',
                    ],[
                        'amount' => '100元/天/户(累计最高赔付不超过180天每次事故不超过90天)',
                        'subName' => '临时住所费用',
                    ]
                ],
            ],
            [
                'productCode' => '155',
                'productName' => '乐驾保全面计划(5座版)',
                'planCode' => '16',
                'planName' => '乐驾保全面计划(5座版)',
                'premium' => '288.00',
                'amount' => '3608000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '20万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '2万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '100元/天/座',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '40万元/户',
                        'subName' => '房屋、室内装修、室内财产',
                    ],
                    [
                        'amount' => "累计赔偿限额200万、每次事故赔偿限额100万、每次事故财产损失赔偿限额50万、每人每次赔偿限额50万、每人医疗费用赔偿限额20万",
                        'subName' => '民用燃气附加第三者责任',
                    ],[
                        'amount' => '100元/天/户(累计最高赔付不超过180天每次事故不超过90天)',
                        'subName' => '临时住所费用',
                    ]
                ],
            ],
            [
                'productCode' => '155',
                'productName' => '乐驾保优选计划(5座版)',
                'planCode' => '11',
                'planName' => '乐驾保优选计划(5座版)',
                'premium' => '518.00',
                'amount' => '3390000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '30万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '3万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '100元/天',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '100万',
                        'subName' => '房屋建筑',
                    ],
                    [
                        'amount' => '10万',
                        'subName' => '室内财产',
                    ],[
                        'amount' => '10万',
                        'subName' => '室内装修',
                    ],
                    [
                        'amount' => '1万',
                        'subName' => '入室盗抢',
                    ],
                    [
                        'amount' => '2万(每次事故责任限额5000元)',
                        'subName' => '个人责任险',
                    ],
                ],
            ],
            [
                'productCode' => '155',
                'productName' => '乐驾保卓越计划(5座版)',
                'planCode' => '12',
                'planName' => '乐驾保卓越计划(5座版)',
                'premium' => '858.00',
                'amount' => '6520000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '60万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '5万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '200元/天',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '200万',
                        'subName' => '房屋建筑',
                    ],
                    [
                        'amount' => '20万',
                        'subName' => '室内财产',
                    ],[
                        'amount' => '20万',
                        'subName' => '室内装修',
                    ],
                    [
                        'amount' => '2万',
                        'subName' => '入室盗抢',
                    ],
                    [
                        'amount' => '4万(每次事故责任限额5000元)',
                        'subName' => '个人责任险',
                    ],
                ],
            ],
            [
                'productCode' => '155',
                'productName' => '乐驾保基本计划(7座版)',
                'planCode' => '17',
                'planName' => '乐驾保基本计划(7座版)',
                'premium' => '198.00',
                'amount' => '2051000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '10万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '1万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '50元/天/座',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '20万元/户',
                        'subName' => '房屋、室内装修、室内财产',
                    ],
                    [
                        'amount' => "累计赔偿限额100万、每次事故赔偿限额50万、每次事故财产损失赔偿限额20万、每人每次赔偿限额30万、每人医疗费用赔偿限额10万",
                        'subName' => '民用燃气附加第三者责任',
                    ],[
                        'amount' => '100元/天/户(累计最高赔付不超过180天每次事故不超过90天)',
                        'subName' => '临时住所费用',
                    ]
                ],
            ],
            [
                'productCode' => '155',
                'productName' => '乐驾保全面计划(7座版)',
                'planCode' => '18',
                'planName' => '乐驾保全面计划(7座版)',
                'premium' => '308.00',
                'amount' => '4084000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '20万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '2万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '100元/天/座',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '40万元/户',
                        'subName' => '房屋、室内装修、室内财产',
                    ],
                    [
                        'amount' => "累计赔偿限额200万、每次事故赔偿限额100万、每次事故财产损失赔偿限额50万、每人每次赔偿限额50万、每人医疗费用赔偿限额20万",
                        'subName' => '民用燃气附加第三者责任',
                    ],[
                        'amount' => '100元/天/户(累计最高赔付不超过180天每次事故不超过90天)',
                        'subName' => '临时住所费用',
                    ]
                ],
            ],
            [
                'productCode' => '155',
                'productName' => '乐驾保优选计划(7座版)',
                'planCode' => '13',
                'planName' => '乐驾保优选计划(7座版)',
                'premium' => '598.00',
                'amount' => '4086000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '30万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '3万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '100元/天',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '100万',
                        'subName' => '房屋建筑',
                    ],
                    [
                        'amount' => '10万',
                        'subName' => '室内财产',
                    ],[
                        'amount' => '10万',
                        'subName' => '室内装修',
                    ],
                    [
                        'amount' => '1万',
                        'subName' => '入室盗抢',
                    ],
                    [
                        'amount' => '2万(每次事故责任限额5000元)',
                        'subName' => '个人责任险',
                    ],
                ],
            ],
            [
                'productCode' => '155',
                'productName' => '乐驾保卓越计划(7座版)',
                'planCode' => '14',
                'planName' => '乐驾保卓越计划(7座版)',
                'premium' => '1008.00',
                'amount' => '7892000.00',
                'maxLimit' => '1',
                'seat' => '5',
                'coverageList' => [
                    [
                        'amount' => '60万元/座',
                        'subName' => '驾乘人员意外伤害身故、残疾',
                    ],
                    [
                        'amount' => '5万元/座',
                        'subName' => '驾乘人员意外伤害医疗',
                    ],
                    [
                        'amount' => '200元/天',
                        'subName' => '驾乘人员意外伤害住院津贴',
                    ],
                    [
                        'amount' => '200万',
                        'subName' => '房屋建筑',
                    ],
                    [
                        'amount' => '20万',
                        'subName' => '室内财产',
                    ],[
                        'amount' => '20万',
                        'subName' => '室内装修',
                    ],
                    [
                        'amount' => '2万',
                        'subName' => '入室盗抢',
                    ],
                    [
                        'amount' => '4万(每次事故责任限额5000元)',
                        'subName' => '个人责任险',
                    ],
                ],
            ],
        ];
        foreach ($list as $item) {
            $productPrinter = new NonCarProductPrinter();
            $productPrinter->productCode = $item['productCode'] ?? '';//产品编码
            $productPrinter->productName = $item['productName'] ?? '';//产品名称
            $productPrinter->productType = '驾意险';
            $productPrinter->productDesc = '';
            $productPrinter->planCode = $item['planCode'] ?? '';//方案代码
            $productPrinter->planName = $item['planName'] ?? '';//方案名称
            $productPrinter->maxQuantity = $item['maxLimit'];//最大购买份数
            $productPrinter->argc['seat'] = $item['seat'] ?? 0;
            foreach ($item['coverageList'] ?? [] as $sub) {
                $subCoverage = new NonCarSubCoveragePrinter();
                $subCoverage->subCode = $sub['subCode'] ?? '';
                $subCoverage->subName = $sub['subName'] ?? '';
                $subCoverage->amount = $sub['amount'] ?? '';
                $productPrinter->subCoverageAppend($subCoverage);
            }
            $productPrinter->premium = $item['premium'];
            $productPrinter->unitAmount = $item['amount'];

            $printer->productListAppend($productPrinter);
        }


        $this->printer = $printer;
        return $this;
    }
}
